<?php
/**
 * Created by PhpStorm.
 * User: mohuani
 * Date: 2019/4/13
 * Time: 16:44
 */

//require_once "App/Utils/Autoloader.php";
//\App\Utils\Autoloader::myAutoload(__CLASS__);


require_once 'global.php';

class Autoloader
{
    public static function myAutoload($name)
    {
        $class_path = str_replace('\\', DIRECTORY_SEPARATOR, $name);
        $file = ROOT_DIR . '/' . $class_path . '.php';
        if (file_exists($file)) {
            require_once $file;
            if (class_exists($name, false)) {
                return true;
            }
        }
        return false;
    }
}

spl_autoload_register('Autoloader::myAutoload');